import { Module } from '@nestjs/common';
import { RolesService } from './roles.service';
import { RolesController } from './roles.controller';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Roles } from './roles.entity';
import { APP_GUARD } from '@nestjs/core';
import { RoleGuard } from '../../guards/roles.guard';
import { UserModule } from '../user/user.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([Roles]),
    UserModule
  ],
  controllers: [RolesController],
  providers: [RolesService,
    {
      provide: APP_GUARD,
      useClass: RoleGuard
    }
  ],
})
export class RolesModule { }
